-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Task2402796] Automatically Create Enum Annotations Based on Controls #215
[Task2402796] Automatically Create Enum Annotations Based on Controls #215
Conversation
…d updated Get MetaData from Results to call it.
...surementLink Measurement Server/Classes/MeasurementPluginService/Get Type Specializations.vi
Show resolved
Hide resolved
Source/Runtime/MeasurementLink Measurement Server/Helpers/Get Results Metadata.vi
Outdated
Show resolved
Hide resolved
Source/Runtime/MeasurementLink Measurement Server/Helpers/Get Configuration Metadata.vi
Outdated
Show resolved
Hide resolved
…d Arrays of Enums.
…call new subVIs. Also resolved some PR comments.
Create Enum Type Specialization:
Get Results Metadata:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look at again when my previous comments are addressed.
…ate Enum Type Specialization.
I don't think we can use an enum control reference here as we pass in both controls references of both enum and arrays of enums as valid input.
Are you referring to
I don't have a fully working example that behaviors correctly in InstrumentStudio yet since there's an issue with serialization/deserialization (which I believe needs to be resolved outside of this LabView code), but I have tested a service with a debugger to verify that an example with an enum will run through this code and produce annotations. For all other comments, I believe I have resolved them as suggested. @jasonmreding Screenshots below: Create Enum Type Specialization.vi Get Enum Type Specialization.vi Get Measurement Configuration Controls.vi |
The array control also has a control reference for the array element, which we get when generating the enum specialization. What I was suggesting is that the Filter for Enum Controls.vi extract this control reference for array controls (casted as enum control reference) and the original control reference for enum controls (casted as enum reference). I think if the various helpers for Is Enum, Is Enum Array, and Is Enum or Enum Array had an output for the casted reference type this would be a little easier and clean up other parts of the diagram throughout. The control ref out could be changed to the more specific type, but I think this might be more confusing than just having a second ref out for the more specific type of control reference. I still like having the Boolean output since it saves the caller from having to check/call Not A Refnum.
I'm referring to this which is called from both Get Configuration Metadata and Get Results Metadata. If I'm reading this correctly, that means we're going to generate enum annotations based on the configuration controls in both cases.
|
Whoops, I accidentally re-requested you. Let me address these comments first. |
…ion CTL Path rather than Measurement Results CTL Path.
…d references. Updated Filter for Enum Controls.vi to extract enum references. Updated Create Enum Type Specialization.vi to only take enum references as input.
…ypes to enum rather than coerced to UInt
…ata subVIs as they really only differed in the path. Now Get MetaData from Results and Get MetaData from Configuration both call into the generic Get Metadata.vi
@jasonmreding I addressed this by refactoring the I addressed the other comments as suggested. Also note the additional change to Create Enum Type Specialization.vi Get Enum Type Specialization.vi Get MetaData from Configuration.vi |
Are there any examples that are already specifying enum type specializations that we should remove them from? |
No, existing examples do not use enums so there's nothing to update. I have an example locally that I've been using for testing and debugging. There was discussion about wanting to add a standalone enum example, but that might not be necessary now that we automatically create enum annotations since the user doesn't need to do anything special. |
IsEnumArrayControl:
Get Enum Type Specializations:
Get Annotations for Parameter:
|
…tionsEntry.ctl rather than the v2.
…again every time I open the project. I'll trust labview and take it's change.
@jasonmreding I've opted not to make any changes for this comment. It seems weird to have Get Enum Type Specialization.vi Parameter_AnnotationsEntry.ctl
|
OOO - Wes has addressed all comments.
What does this Pull Request accomplish?
Create Enum Type Specialization.vi
to take a generic control and function for both enum controls and array of enums controls.Get Results Metadata.vi
that mirrorsGet Configuration Metadata.vi
Get Type Specializations.vi
was not updated to reference the updatedType Specialization.ctl
andType Specialization Key.ctl
.Why should this Pull Request be merged?
AB#2366055
AB#2402796
See related discussion from #213 .
What testing has been done?